const express = require("express")
const router = express.Router()

const loginRouter = require('../../controller/login')
//引入role

const { getUser, createUser, deleteUser, selectIfId, updataCole, updataPassword } = require('../../controller/user/index')
const { getInfo, addInfo }=require('../../controller/info/index')

const { getRole, amendRoleStatus, getSearch, removeRole, insertRole,amendRole } = require('../../controller/role/index');


// 登录路由
router.use("/login", loginRouter)
// 获取role数据
router.use("/role/getRole",getRole);
// 修改role角色状态
router.use("/role/amendRoleStatus", amendRoleStatus);
// 搜索
router.use("/role/getSearch", getSearch);
// 删除
router.use("/role/removeRole", removeRole);
// 添加
router.post("/role/insertRole", insertRole);
//修改
router.post("/role/amendRole", amendRole);


router.use("/User/getUser", getUser)
router.use("/user/createUser", createUser)
router.use("/User/deleteUser", deleteUser)
router.use("/User/selectIfId", selectIfId)
router.use("/User/updataCole", updataCole)
router.use("/User/updataPassword", updataPassword)

router.use('/info/getInfo',getInfo)
router.use('/info/addInfo',addInfo)
module.exports = router;
